Integrand size = 41, antiderivative size = 367 \[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (2 a^2 C+b^2 C (3+m)+A b^2 (4+m)+2 a b B (4+m)\right ) \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m) (4+m)}+\frac {b (2 a C+b B (4+m)) \cos ^{2+m}(c+d x) \sin (c+d x)}{d (3+m) (4+m)}+\frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}-\frac {\left (2 a b B \left (4+5 m+m^2\right )+a^2 (4+m) (C (1+m)+A (2+m))+b^2 (1+m) (C (3+m)+A (4+m))\right ) \cos ^{1+m}(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+m}{2},\frac {3+m}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (1+m) (2+m) (4+m) \sqrt {\sin ^2(c+d x)}}-\frac {\left (b^2 B (2+m)+a^2 B (3+m)+2 a b (C (2+m)+A (3+m))\right ) \cos ^{2+m}(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {4+m}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (2+m) (3+m) \sqrt {\sin ^2(c+d x)}} \]
[Out]
Time = 1.01 (sec) , antiderivative size = 367, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3128, 3112, 3102, 2827, 2722} \[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {\sin (c+d x) \cos ^{m+1}(c+d x) \left (a^2 (m+4) (A (m+2)+C (m+1))+2 a b B \left (m^2+5 m+4\right )+b^2 (m+1) (A (m+4)+C (m+3))\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m+1}{2},\frac {m+3}{2},\cos ^2(c+d x)\right )}{d (m+1) (m+2) (m+4) \sqrt {\sin ^2(c+d x)}}-\frac {\sin (c+d x) \cos ^{m+2}(c+d x) \left (a^2 B (m+3)+2 a b (A (m+3)+C (m+2))+b^2 B (m+2)\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m+2}{2},\frac {m+4}{2},\cos ^2(c+d x)\right )}{d (m+2) (m+3) \sqrt {\sin ^2(c+d x)}}+\frac {\sin (c+d x) \cos ^{m+1}(c+d x) \left (2 a^2 C+2 a b B (m+4)+A b^2 (m+4)+b^2 C (m+3)\right )}{d (m+2) (m+4)}+\frac {b \sin (c+d x) (2 a C+b B (m+4)) \cos ^{m+2}(c+d x)}{d (m+3) (m+4)}+\frac {C \sin (c+d x) \cos ^{m+1}(c+d x) (a+b \cos (c+d x))^2}{d (m+4)} \]
[In]
[Out]
Rule 2722
Rule 2827
Rule 3102
Rule 3112
Rule 3128
Rubi steps \begin{align*} \text {integral}& = \frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}+\frac {\int \cos ^m(c+d x) (a+b \cos (c+d x)) \left (a (C (1+m)+A (4+m))+(b C (3+m)+(A b+a B) (4+m)) \cos (c+d x)+(2 a C+b B (4+m)) \cos ^2(c+d x)\right ) \, dx}{4+m} \\ & = \frac {b (2 a C+b B (4+m)) \cos ^{2+m}(c+d x) \sin (c+d x)}{d (3+m) (4+m)}+\frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}+\frac {\int \cos ^m(c+d x) \left (a^2 (3+m) (C (1+m)+A (4+m))+(4+m) \left (b^2 B (2+m)+a^2 B (3+m)+2 a b (C (2+m)+A (3+m))\right ) \cos (c+d x)+(3+m) \left (2 a^2 C+b^2 C (3+m)+A b^2 (4+m)+2 a b B (4+m)\right ) \cos ^2(c+d x)\right ) \, dx}{12+7 m+m^2} \\ & = \frac {\left (2 a^2 C+b^2 C (3+m)+A b^2 (4+m)+2 a b B (4+m)\right ) \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m) (4+m)}+\frac {b (2 a C+b B (4+m)) \cos ^{2+m}(c+d x) \sin (c+d x)}{d (3+m) (4+m)}+\frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}+\frac {\int \cos ^m(c+d x) \left ((3+m) \left (2 a b B \left (4+5 m+m^2\right )+a^2 (4+m) (C (1+m)+A (2+m))+b^2 (1+m) (C (3+m)+A (4+m))\right )+(2+m) (4+m) \left (b^2 B (2+m)+a^2 B (3+m)+2 a b (C (2+m)+A (3+m))\right ) \cos (c+d x)\right ) \, dx}{24+26 m+9 m^2+m^3} \\ & = \frac {\left (2 a^2 C+b^2 C (3+m)+A b^2 (4+m)+2 a b B (4+m)\right ) \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m) (4+m)}+\frac {b (2 a C+b B (4+m)) \cos ^{2+m}(c+d x) \sin (c+d x)}{d (3+m) (4+m)}+\frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}+\frac {\left (b^2 B (2+m)+a^2 B (3+m)+2 a b (C (2+m)+A (3+m))\right ) \int \cos ^{1+m}(c+d x) \, dx}{3+m}+\frac {\left (2 a b B \left (4+5 m+m^2\right )+a^2 (4+m) (C (1+m)+A (2+m))+b^2 (1+m) (C (3+m)+A (4+m))\right ) \int \cos ^m(c+d x) \, dx}{8+6 m+m^2} \\ & = \frac {\left (2 a^2 C+b^2 C (3+m)+A b^2 (4+m)+2 a b B (4+m)\right ) \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m) (4+m)}+\frac {b (2 a C+b B (4+m)) \cos ^{2+m}(c+d x) \sin (c+d x)}{d (3+m) (4+m)}+\frac {C \cos ^{1+m}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{d (4+m)}-\frac {\left (2 a b B \left (4+5 m+m^2\right )+a^2 (4+m) (C (1+m)+A (2+m))+b^2 (1+m) (C (3+m)+A (4+m))\right ) \cos ^{1+m}(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+m}{2},\frac {3+m}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (1+m) \left (8+6 m+m^2\right ) \sqrt {\sin ^2(c+d x)}}-\frac {\left (b^2 B (2+m)+a^2 B (3+m)+2 a b (C (2+m)+A (3+m))\right ) \cos ^{2+m}(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {4+m}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (2+m) (3+m) \sqrt {\sin ^2(c+d x)}} \\ \end{align*}
Time = 3.23 (sec) , antiderivative size = 268, normalized size of antiderivative = 0.73 \[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {\cos ^{1+m}(c+d x) \csc (c+d x) \left (-\frac {a^2 A \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+m}{2},\frac {3+m}{2},\cos ^2(c+d x)\right )}{1+m}+\cos (c+d x) \left (-\frac {a (2 A b+a B) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {4+m}{2},\cos ^2(c+d x)\right )}{2+m}+\cos (c+d x) \left (-\frac {\left (A b^2+a (2 b B+a C)\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+m}{2},\frac {5+m}{2},\cos ^2(c+d x)\right )}{3+m}+b \cos (c+d x) \left (-\frac {(b B+2 a C) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+m}{2},\frac {6+m}{2},\cos ^2(c+d x)\right )}{4+m}-\frac {b C \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {5+m}{2},\frac {7+m}{2},\cos ^2(c+d x)\right )}{5+m}\right )\right )\right )\right ) \sqrt {\sin ^2(c+d x)}}{d} \]
[In]
[Out]
\[\int \left (\cos ^{m}\left (d x +c \right )\right ) \left (a +b \cos \left (d x +c \right )\right )^{2} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right )d x\]
[In]
[Out]
\[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
\[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^m(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int {\cos \left (c+d\,x\right )}^m\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^2\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right ) \,d x \]
[In]
[Out]